package com.apposcopy.ella.runtime;

import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class BroadcastReceiver extends android.content.BroadcastReceiver
{
	private static final String TAG = BroadcastReceiver.class.getSimpleName();
	public static final String START_RECORD = "edu.iscas.appcheckclient.broadcastreceiver.START_RECORD";
	public static final String STOP_RECORD = "edu.iscas.appcheckclient.broadcastreceiver.STOP_RECORD";
	public void onReceive(Context context, Intent intent) {
		switch(intent.getAction()){
		case START_RECORD:
			Log.d(TAG, "received start record message");
			Ella.startRecord();
			break;
		case STOP_RECORD:
			Log.d(TAG, "received stop record message");
			Ella.stopRecord();
			break;
		}
//		Log.d("ella", "Broadcast received.");
//		Log.d("ella", "To stop uploading coverage data.");
//		Ella.stopRecording();
	}
}
